<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>管理员登录</title>
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet"
	href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script
	src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript"
	src="resource/bootstrap-3.3.7-dist/js/jquery-2.1.1.js"></script>
<link rel="stylesheet"
	href="resource/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
<script type="text/javascript"
	src="resource/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
</head>
<body>
	<div
		style="width: 500px;padding:10px; height: 300px; margin: auto;  border:2px  solid  gray; margin-top: 100px">
		<fieldset style="width: 100%">
			<legend>管理员登录</legend>
		</fieldset>
		<form class="form-horizontal">
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">手机号</label>
				<div class="col-sm-10">
					<input type="text" name="phone" id="admin_phone" value=""
						class="form-control" required placeholder="请输入手机号" >
				</div>
			</div>
			<div class="form-group">
				<label for="inputPassword3" class="col-sm-2 control-label">密码</label>
				<div class="col-sm-10">
					<input type="password" name="password" id="admin_password" value=""
						required class="form-control" placeholder="Password">
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-default" id="loginbtn">登录</button>
				</div>
			</div>
		</form>
	</div>
</body>
<script type="text/javascript">
	$("#loginbtn").click(function(){
		$.ajax({
			url : "http://127.0.0.1/admin/adminlogin.action",
			data : {"admin_phone":$("#admin_phone").prop("value"),"admin_password":$("#admin_password").prop("value")},
			type : "get",
			success : function(result) {
				if(result>0){
					window.location.href="http://127.0.0.1/index.html"; 
				}else{
					alert("用户名或密码错误！");
					$("#admin_phone").prop("value","");
					$("#admin_password").prop("value","");
				}
				
			}
		});
		
		
	});
</script>
</html>